import Mock from "mockjs";

Mock.mock("/api/sys/current_user", (): ResultData<IUserInfo> => {
  const name = Mock.Random.cname();
  let data: IUserInfo = {
    staffId: "123454",
    name,
    id: "",
    userRoles: ["admin"],
    perms: ["*"],
  };

  return {
    code: 0,
    msg: "操作成功",
    data,
  };
});

//管理员列表
Mock.mock(/\/api\/systemAccount\/list/, (): ResultData<IList<IAdminUser>> => {
  
  let data: IList<IAdminUser> = {
    list: [
      {
        staffId: "123454",
        staffName: "测试管理员",
        id: "1234434",
      },
      {
        staffId: "1234514",
        staffName: "测试管理员2",
        id: "114434",
      },
    ],
    total: 2,
    page: 1,
  };

  return {
    code: 0,
    msg: "操作成功",
    data,
  };
});

//员工列表
Mock.mock(/\/api\/emp\/list/, (): ResultData<IList<IEmployee>> => {
  let data: IList<IEmployee> = {
    list: [
      {
        staffId: "120001",
        name: Mock.Random.cname(),
        depart:'测试学院1'
      },
      {
        staffId: "120002",
        name: Mock.Random.cname(), 
        depart:'测试学院2'
      },
    ],
    total: 2,
    page: 1,
  };

  

  return {
    code: 0,
    msg: "操作成功",
    data,
  };
});
